# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-zmq
_pkgreal=zmq
pkgver=1.1.3
pkgrel=8
pkgdesc="PHP extension for ZeroMQ - PECL"
url="https://pecl.php.net/package/zmq"
arch="all"
license="PHP-3.01"
depends="php7-common"
makedepends="php7-dev zeromq-dev"
source="$pkgname-$pkgver.tgz::https://pecl.php.net/get/$_pkgreal-$pkgver.tgz
	fix-php-7.3-compile.patch
	fix-php-7.4-compile.patch"
builddir="$srcdir/$_pkgreal-$pkgver"
provides="php7-zmq=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-zmq" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	local confdir="$pkgdir/etc/php7/conf.d"
	mkdir -p "$confdir"
	echo "extension=$_pkgreal.so" > "$confdir"/50_$_pkgreal.ini
}

sha512sums="0f03016e315a6c6a1e1d6eca1e20564834d2a924cef06af1b38693933f1e5a094c37e9c432705a64f61d95e82655f61358fc7783e7a6f06c7dd9ad84fc6f7bbc  php7-pecl-zmq-1.1.3.tgz
3fda312b76106a1b78e35ffce3199bf52d040008e5fc9c134dd0b3f4a41ceef8857e8cae10b208dfd9b7394dfea652533a258f523da9b5f870d381bddd780797  fix-php-7.3-compile.patch
58288af1fd1441491c7f5cc7be967ba8e806a8d80141d4c3699af9a977ede57f3f464922bc218f3aabdce965699fea5a016954ca538f98559553625d33ff2d4f  fix-php-7.4-compile.patch"
